<template>
    <h3>当前位置：{{ TITLE.referral2 }}</h3>
    <div class="outbox">
        <div :style="{ height, width }" class="list">
            <bListSearch :instance="mSearch">
                <ElButton @click="() => mSearch.onSearch()" type="primary">搜索</ElButton>
            </bListSearch>
            <bTable :label="pList.labels" :table-data="pList.list" :total="pList.total" :is-h="[]" :stripe="true"
                :border="false" :limit="pList.limit" @currentchange="onCurrentchange">
            </bTable>
        </div>
    </div>
</template>
<script setup lang="ts">
import { EDP } from '@b/model/enum';
import { TITLE } from "@b/model/enum";
import { ref } from 'vue';
import bTable from "@/components/public/b_table.vue";
import bListSearch from "@/components/public/b_list_search.vue";
import { ElButton } from "element-plus";
import { Referral2, ReferralSearch } from "@b/index/referral";
import { reactive } from "vue";
const pList = reactive(new Referral2())
const mSearch = reactive(new ReferralSearch())
const height = ref(EDP.HEIGHT + 'px')
const width = ref(EDP.WIDTH + 'px')

mSearch.onSearch = async () => {
    pList.search_key = mSearch.getData()
    pList.refresh(1);
}
mSearch.onSearch()
const onCurrentchange = (page: number) => {
    pList.refresh(page)
}
</script>

<style scoped>
.list {
    overflow: auto;
}
</style>